package com.wuxu.ads_no.domain.page

import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.tooling.preview.Preview
import com.wuxu.ads_no.ui.theme.Ads_NoTheme

/**
 *@author wuxu 21057340
 *@date 2024/2/19 7:07 PM
 *@description 设置页面
 */
class ConfigActivity: ComponentActivity() {
    @OptIn(ExperimentalMaterial3Api::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            Ads_NoTheme(){
                Column(
                ){
                    val textValue = remember {
                        mutableStateOf("")
                    }
                    TextField(value = textValue.value,onValueChange = {
                            textValue.value = it
                    },placeholder = {
                        Text(text = "输入应用包名")
                    })

                    Box(modifier =Modifier.pointerInput(Unit){
                        detectTapGestures(
                            onPress = {
                               Toast.makeText(this@ConfigActivity,"x:${it.x},y:${it.y}",Toast.LENGTH_SHORT).show()
                            }
                        )
                    })
                }
            }
        }
    }
}



@Preview
@Composable
fun preView(){

}